<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <title>骨医快线</title>
    <link rel="stylesheet" href="../../css/mui.plus.css" />
    <style>
    	.mui-table-view:after {
    		height: 0;
    	}
    </style>
</head>
<body>
	<header class="mui-bar mui-bar-nav pri-bar">
	    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
	    <h1 class="mui-title">我的收藏</h1>
	</header>
	<div class="mui-content home">
		<ul id="list-coll" class="mui-table-view common-img-text-list">
			<div class="oe-emp">
				<img src="../../images/blank_page/empty-helper@2x.png"/>
			</div>
		</ul>
	</div>
	
	<script id="tmp-coll" type="text/html">
		{{each data as v i }}
			<li class="mui-table-view-cell mui-media" data-newsid = "{{v.news_id}}">
				<a href="javascript:;">
					<img class="mui-media-object mui-pull-left" src="{{v.news_first_img}}">
					<div class="mui-media-body">{{v.news_title}}
						<p>{{v.news_intro}}</p>
					</div>
				</a>
			</li>
		{{/each}}
	</script>
	
	<script src="../../js/mui.min.js"></script>
	<script src="../../js/app.js"></script>
	<script src="../../js/lib/template.js"></script>
	<script type="text/javascript" charset="utf-8">
      	(function($, doc){
      		var tmpData,
      			html,
      			listColl = document.getElementById("list-coll");
      			
      		var getCollData = function(){
      			app.net.get('c_news/show_collect_news_list', {dr_id: app.storage.getUserId()}, function(data){
      				if(data && data.code === '100' && !(/空数据/.test(data.msg))){
      					tmpData = data;
      					html = template('tmp-coll', tmpData);
      					listColl.innerHTML = html;
      				}else {
      					listColl.innerHTML = '<p>暂时没有任何收藏哦</p>';
      				}
      			});
      		};
      		
      		$('#list-coll').on('tap', 'li', function(){
      			$.openWindow({
			  		url: '../info/detail-sub.html',
			  		waiting: {
						autoShow: false
					},
					extras: {
						newsid : this.dataset.newsid
					}
			  	});
      		});
      			
      		//底层支持准备完毕
      		$.plusReady(function(){
				plus.webview.currentWebview().setStyle({scrollIndicator:'none'});
				
				getCollData();
								
      		});
      	}(mui, document));
    </script>
</body>
</html>